package com.iszhangsc.backup.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * <p>
 * 数据库备份记录表
 * </p>
 *
 * @author zhāngshìchāng
 * @date 2020/12/8 3:15 下午
 */
@Data
@Entity
@Table(name = "backup_record")
@EntityListeners(AuditingEntityListener.class)
public class BackupRecord {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "主键", example = "1")
    private Integer id;

    @ApiModelProperty(value = "备份路径", example = "/tmp/xx.sql")
    private String path;

    @ApiModelProperty(value = "文件大小", example = "2M")
    private String size;

    @CreatedDate
    @ApiModelProperty(value = "备份时间", example = "2020-11-11 11:11:11")
    private Date backupTime;

    @ApiModelProperty(value = "备份结果", example = "备份成功")
    private String backupMsg;

    @ApiModelProperty(value = "还原时间", example = "2020-11-11 11:11:11")
    private Date restoreTime;

    @ApiModelProperty(value = "还原结果", example = "还原成功")
    private String restoreMsg;


}
